package org.juiceshop.musi.midi;

public enum Instrument {

	ACOUSTIC_GRAND, // 0
    BRIGHT_ACOUSTIC, // 1
    ELECTRIC_GRAND, // 2
    HONKEY_TONK, // 3
    ELECTRIC_PIANO_1, // 4
    ELECTRIC_PIANO_2, // 5
    HARPISCHORD, // 6
    CLAVINET, // 7
    CELESTA, // 8
    GLOCKENSPIEL, // 9

    MUSIC_BOX, // 10
    VIBRAPHONE, // 11
    MARIMBA, // 12
    XYLOPHONE, // 13
    TUBULAR_BELLS, // 14
    DULCIMER, // 15
    DRAWBAR_ORGAN, // 16
    PERCUSSIVE_ORGAN, // 17
    ROCK_ORGAN, // 18
    CHURCH_ORGAN, // 19

    REED_ORGAN, // 20
    ACCORDIAN, // 21
    HARMONICA, // 22
    TANGO_ACCORDIAN, // 23
    NYLON_STRING_GUITAR, // 24
    STEEL_STRING_GUITAR, // 25
    ELECTRIC_JAZZ_GUITAR, // 26
    ELECTRIC_CLEAN_GUITAR, // 27
    ELECTRIC_MUTED_GUITAR, // 28
    OVERDRIVEN_GUITAR, // 29

    DISTORTION_GUITAR, // 30
    GUITAR_HARMONICS, // 31
    ACOUSTIC_BASS, // 32
    ELECTRIC_BASS_FINGER, // 33
    ELECTRIC_BASS_PICK, // 34
    FRETLESS_BASS, // 35
    SLAP_BASS_1, // 36
    SLAP_BASS_2, // 37
    SYNTH_BASS_1, // 38
    SYNTH_BASS_2, // 39

    VIOLIN, // 40
    VIOLA, // 41
    CELLO, // 42
    CONTRABASS, // 43
    TREMOLO_STRINGS, // 44
    PIZZICATO_STRINGS, // 45
    ORCHESTRAL_STRINGS, // 46
    TIMPANI, // 47
    STRING_ENSEMBLE_1, // 48
    STRING_ENSEMBLE_2, // 49

    SYNTH_STRINGS_1, // 50
    SYNTH_STRINGS_2, // 51
    CHOIR_AAHS, // 52
    VOICE_OOHS, // 53
    SYNTH_VOICE, // 54
    ORCHESTRA_HIT, // 55
    TRUMPET, // 56
    TROMBONE, // 57
    TUBA, // 58
    MUTED_TRUMPET, // 59

    FRENCH_HORN, // 60
    BRASS_SECTION, // 61
    SYNTHBRASS_1, // 62
    SYNTHBRASS_2, // 63
    SOPRANO_SAX, // 64
    ALTO_SAX, // 65
    TENOR_SAX, // 66
    BARITONE_SAX, // 67
    OBOE, // 68
    ENGLISH_HORN, // 69

    BASSOON, // 70
    CLARINET, // 71
    PICCOLO, // 72
    FLUTE, // 73
    RECORDER, // 74
    PAN_FLUTE, // 75
    BLOWN_BOTTLE, // 76
    SKAKUHACHI, // 77
    WHISTLE, // 78
    OCARINA, // 79

    SQUARE, // 80
    SAWTOOTH, // 81
    CALLIOPE, // 82
    CHIFF, // 83
    CHARANG, // 84
    VOICE, // 85
    FIFTHS, // 86
    BASSLEAD, // 87
    NEW_AGE, // 88
    WARM, // 89

    POLYSYNTH, // 90
    CHOIR, // 91
    BOWED, // 92
    METALLIC, // 93
    HALO, // 94
    SWEEP, // 95
    RAIN, // 96
    SOUNDTRACK, // 97
    CRYSTAL, // 98
    ATMOSPHERE, // 99

    BRIGHTNESS, // 100
    GOBLINS, // 101
    ECHOES, // 102
    SCI, // 103
    SITAR, // 104
    BANJO, // 105
    SHAMISEN, // 106
    KOTO, // 107
    KALIMBA, // 108
    BAGPIPE, // 109

    FIDDLE, // 110
    SHANAI, // 111
    TINKLE_BELL, // 112
    AGOGO, // 113
    STEEL_DRUMS, // 114
    WOODBLOCK, // 115
    TAIKO_DRUM, // 116
    MELODIC_TOM, // 117
    SYNTH_DRUM, // 118
    REVERSE_CYMBAL, // 119

    GUITAR_FRET_NOISE, // 120
    BREATH_NOISE, // 121
    SEASHORE, // 122
    BIRD_TWEET, // 123
    TELEPHONE_RING, // 124
    HELICOPTER, // 125
    APPLAUSE, // 126
    GUNSHOT; //127
    
    public static final Instrument PIANO = ACOUSTIC_GRAND;
    public static final Instrument ELECTRIC_PIANO = ELECTRIC_PIANO_1;
    public static final Instrument GUITAR = NYLON_STRING_GUITAR;

    public static Instrument valueOf(int index) {
    	return values()[index];
    }
    
    public static Instrument fromString(String name) {
    	if (name.equals("PIANO")) return PIANO;
    	if (name.equals("ELECTRIC_PIANO")) return ELECTRIC_PIANO;
    	if (name.equals("GUITAR")) return GUITAR;
    	try {
        	return valueOf(name);
    	} catch (IllegalArgumentException ex) {
    		return null;
    	}
    }

}
